package com.common.frame.utils;

import java.util.Map;

import okhttp3.MediaType;
import okhttp3.RequestBody;

/**
 * RequestUtils
 */
public class RequestUtils {


    private static String paramToJson(Map<String, Object> param) {
        return GsonUtils.getGson().toJson(param);
    }


    public static RequestBody paramsToRequestBody(Map<String, Object> param){
        String json = paramToJson(param);
        return paramsToRequestBody(json);
    }

    public static RequestBody paramsToRequestBody(String string){
        return RequestBody.create(MediaType.parse("application/json"), string);
    }



}